// 引入
import axios from 'axios'
// import config from 'vue/types/umd'

// 创建axios 实例

let service = axios.create({
  baseURL: "/api", //服务器的根地址
  timeout: 6000 //
})
//3创建请求拦截
service.interceptors.request.use(
  config => {
    return config
  },
  err => {
    return Promise.reject(err)

  }
)
//4响应拦截
service.interceptors.response.use(
  response => {
    return response.data
  },
  err => {
    return Promise.reject(err)
  }
)

//响应拦截

export default service